﻿using Data.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace MVCAngularJS.Controllers
{
    public class PostController : ApiController
    {
        private readonly IPostService _postService;

        public PostController(IPostService postService)
        {
            _postService = postService;
        }

        public IHttpActionResult Get(int id)
        {
            var post = _postService.GetPostsByBlogId(id);
            return Ok(post);
        }
    }
}
